package com.woniuxy.service.business;

import com.woniuxy.entity.BorrowDemand;
import com.woniuxy.entity.BusinessInfo;
import com.woniuxy.utils.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * business模块的feign都在这儿哈
 * @author shichen
 * @create 2021-11-17-21:56
 * @description
 */
@FeignClient(name = "business")
public interface BorrowDemandService {

    @PostMapping("/insert")
    public ResponseResult insert(@RequestBody BorrowDemand borrowDemand);

    @GetMapping("/select/{id}")
    public ResponseResult select(@PathVariable("id") int id);

    //查找所有企业
    @GetMapping("/businessInfo/getAll")
    public ResponseResult getAllBusinessInfo(@RequestParam("business_name") String business_name,
            @RequestParam("pageIndex")int pageIndex, @RequestParam("pageSize")int pageSize);

    //添加
    @PostMapping("/businessInfo/add")
    public ResponseResult addBusinessInfo(@RequestBody BusinessInfo businessInfo);

    //删除
    @DeleteMapping("/businessInfo/delete/{business_name}")
    public ResponseResult removeBusinessInfo(@PathVariable("business_name") String business_name);

    @GetMapping("/businessInfo/{id}")
    public ResponseResult<BusinessInfo> getBusinessInfoById(@PathVariable("id") int id);

    @GetMapping("/businessInfo/BusinessName/{businessName}")
    public ResponseResult<BusinessInfo> getBusinessInfoByBusinessName(@PathVariable("businessName") String business_name);
}
